package main

import (
	"fmt"
	"os"
)

func main() {
	mapping := func(s string) string {
		m := map[string]string{"widuu": "www.widuu.com", "xiaowei": "widuu"}
		return m[s]
	}
	data := "hello $xiaowei blog address $widuu"
	fmt.Printf("%s", os.Expand(data, mapping)) //输出hello widuu blog address www.widuu.com
}
